package PTA;

import java.util.Scanner;

interface Motor
{
    public static float power=100;
    public static float carrier=100;
    public void transport();
}
class Train implements Motor {
    @Override
    public void transport() {
        System.out.println("车次为30，节数为：20的火车开始进行货物运输。");
    }
}
class Car implements Motor {
    @Override
    public void transport() {
        System.out.println("汽车开始进行货物运输。");
    }
}
class Tractor implements Motor {
    @Override
    public void transport() {
        System.out.println("拖拉机在耕地");
        System.out.println("拖拉机开始进行货物运输。");
    }
}
class Factory7 {
    public static Motor createMotor(String name) {
        if(name.equals("火车"))
            return new Train();
        else if(name.equals("汽车"))
            return new Car();
        else if(name.equals("拖拉机"))
            return new Tractor();
        else
            return null;
    }
}
public class t6 {
    public static void main(String args[]){
        Scanner scan=new Scanner(System.in);
        String name;
        name=scan.next();
        Motor m= Factory7.createMotor(name);
        if(m==null)
            System.out.println("没有此类车。");
        else
            m.transport();
    }
}
